package com.cx.text;

import com.cx.controller.FoodController;
import com.cx.entity.Foods;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class FoodText {
    @Test
    public void t1(){
        // 模拟客户点菜，勾了菜单中，编号为1的菜
        int id = 1;
        // Spring框架，不自己new,从IOC容器拿
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        FoodController controller = context.getBean(FoodController.class);
        Foods food = controller.orderTeacher(id);
        System.out.println("Food = " + food);
    }


}
